package com.itheima.demo03;

import java.util.concurrent.Callable;

public class MyCallable implements Callable<Integer> { //这里的 <Integer> 泛型是只 call 方法返回的类型
    @Override
    public Integer call() throws Exception {
        //求 1 ~ 100 的和
        int sum = 0;

        for (int i = 1; i <= 100; i++) {
            sum = sum + i;
        }

        return sum;
    }
}
